<?php
declare (strict_types = 1);

namespace app\api\controller;

use app\api\model\ActivityMessage;
use think\Request;

class StoreActivityController
{
    /**
     * 门店社区消息展示接口
     */
    public function messageList()
    {
        //1、接收用户id
        $uid = input('user_id');
        //2、验证数据
        if (!is_numeric($uid)) return json(['code' => 4003, 'msg' => '用户id错误', 'data' => '']);

        //3、查询数据
        $activityMessageList = ActivityMessage::with('goods')
            ->where('user_id', $uid)
            ->where('activity_type', 1)->select();

        return json(['code' => 200, 'msg' => '查询成功', 'data' => $activityMessageList]);
    }
}
